<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  /*宋晴*/
  function myInstanceof(target, MyClass) {
    if (!target || !MyClass || !target.__proto__ || !MyClass.prototype) {
      return false
    }
    let center = target.__proto__;
    while (center) {
      if (center === MyClass.prototype) {
        return true
      }
      center = center.__proto__
    }
    return false
  }

  let arr = [1, 2, 3];
  console.log(myInstanceof(arr, Array))

</script>
</body>
</html>
